﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Connections.ascx.cs" Inherits="Cyberwolf.Modules.PWCAPAdmin.Configuration.Connections" %>
<%@ register src="../UserControls/MainMenu.ascx" tagname="MainMenu" tagprefix="pw" %>
<%@ register src="../UserControls/ModalFrame.ascx" tagname="ModalFrame" tagprefix="pw" %>
<asp:panel id="pnPWCAPAdminContainer" runat="server">
<div id="PWCAPAdminContainer">
    <div id="dvhead">
        <div class="nav">
            <asp:linkbutton id="lnkLogout" onclick="lnkLogout_Click" runat="server"></asp:linkbutton>
            <pw:MainMenu id="pwMenu" runat="server"></pw:MainMenu>
            <br class="clearfix" />
        </div>
    </div>
    <div id="dvflash">
        <asp:literal id="litNoticeFlash" runat="server" enableviewstate="false"></asp:literal>
        <asp:literal id="litErrorFlash" runat="server" enableviewstate="false"></asp:literal>
    </div>
    <div id="dvcontent">
        <div class="buttons">
            <asp:button id="btnAddNew" runat="server" resourcekey="AddNew" onclientclick="openConnection(''); return false;" />
            <br class="clearfix" />
        </div>
        <div>
            <asp:gridview id="gridConnection" runat="server" gridlines="None" cssclass="grid" autogeneratecolumns="False" onrowcreated="gridConnection_RowCreated" onrowdatabound="gridConnection_RowDataBound" onrowcommand="gridConnection_RowCommand">
                <alternatingrowstyle cssclass="e" />
                <columns>
                    <asp:boundfield datafield="Environment_Name" headertext="Env. Name" headerstyle-width="100px" />
                    <asp:boundfield datafield="Organization_ID" headertext="Org. ID" headerstyle-width="120px" />
                    <asp:boundfield datafield="Logical_Name" headertext="Logical Name" headerstyle-width="120px" />
                    <asp:boundfield datafield="Description" headertext="Description" headerstyle-width="240px" />
                    <asp:templatefield headertext="Connection String">
                        <itemtemplate>
                            <asp:textbox id="txtConnection_Data" readonly="true" textmode="MultiLine" runat="server" />
                        </itemtemplate>
                    </asp:templatefield>
                    <asp:templatefield>
                        <itemtemplate>
                            <asp:image id="imgEdit" imageurl="../images/refresh.png" runat="server" />
                            <asp:imagebutton id="btnDelete" CommandArgument='<%# Eval("Organization_ID") %>' imageurl="../images/delete.png" commandname="remove" runat="server" />
                        </itemtemplate>
                    </asp:templatefield>
                </columns>
                <emptydatatemplate>
                    <div class="ferror">
                        <asp:label id="lbNoRecords" runat="server" resourcekey="lbNoRecords">No record found.</asp:label>
                    </div>
                </emptydatatemplate>
            </asp:gridview>
            <pw:ModalFrame ID="DConnectionFrame" runat="server" Height="500" Width="640" />
        </div>
    </div>
    <div id="modalbg"></div>
</div>
<script type="text/javascript">
function openConnection(oid)
{
    <%= DConnectionFrame.OpenFunction %>('<%= ResolveUrl("Connection.aspx?tabid=" + this.TabId + "&mid=" + this.ModuleId) %>&oid=' + oid, '<%= Localization.GetString("ConnectionCaption.Text", this.LocalResourceFile) %>');
};
</script>
</asp:panel>